﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="edit">
    <tr>
        <td class="label required">
            Tên Người Dùng<span>*</span>
        </td>
        <td class="input">
            <% if (ViewData.Model == null)
               {
                   Response.Write(Html.TextBox("UserName", "", new { @maxlength = "40", @style = "width:200px" }));         
               }
               else
               {
                   Response.Write(Html.TextBox("UserName", ((User_Group)ViewData.Model).UserAdmin.UserName, new { @maxlength = "40", @readonly = true, @style = "width:200px" }));
                   Response.Write(Html.Hidden("ID", ((User_Group)ViewData.Model).ID));
                   Response.Write(Html.Hidden("UpdateDate", ((User_Group)ViewData.Model).UpdateDate.ToString()));
               }
            %>
        </td>
    </tr>
    <% if (ViewData.Model == null)
       { %>
    <tr>
        <td class="label required">
            Mật Khẩu<span>*</span>
        </td>
        <td class="input">
            <% Response.Write(Html.TextBox("Password", "", new
               {
                   @maxlength = "40",
                   @style = "width:200px",
                   @type = "password"
               })); %>
        </td>
    </tr>
    <tr>
        <td class="label required">
            Xác Nhận MK<span>*</span>
        </td>
        <td class="input">
            <% Response.Write(Html.TextBox("ConfirmPassword", "", new
               {
                   @maxlength = "40",
                   @style = "width:200px",
                   @type = "password"
               })); %>
        </td>
    </tr>
    <% 
        }               
    %>
    <tr>
        <td class="label required">
            Nhóm
        </td>
        <td valign="bottom" class="input">
            <% if (ViewData.Model == null)
               {
                   Response.Write(Html.DropDownList("GroupId", null, new { @style = "width:207px" }));
               }
               else
               {
                   Response.Write(Html.DropDownList("GroupId", null, new { @style = "width:207px" }));
               }
            %>
        </td>
    </tr>
    <tr>
        <td class="label">
            Kích Hoạt
        </td>
        <td valign="bottom" class="input">
            <% 
                string check = "checked=\"checked\"";
                if (ViewData.Model != null)
                {
                    check = ((User_Group)ViewData.Model).IsActive ? "checked=\"checked\"" : "";
                }
                Response.Write("<input type=\"checkbox\" value=\"true\" name=\"IsActive\" id=\"IsActive\" " + check + " />");
            %>
        </td>
    </tr>
    <tr>
        <td>
        </td>
        <td>
            <input type="submit" class="save" value="" alt="Update" />
            <input type="button" class="cancel" value="" alt="" onclick="JS_LIB.closePopup()" />
        </td>
    </tr>
</table>
